import request from "@/apps/admin/units/request"
import {TableColumn} from "@/components/AppTable/TableType";
import {HttpResultData} from "@/types/project";


type FilterData = {
    api: string
    columns: TableColumn[]
    labelKey?: string
    query?: { [key: string]: any }
}

/**
 * 部门授权数据员工
 */
export const depauthUserFilterData: FilterData = {
    api: '/filter-panel/depauth-user',
    columns: [
        {prop: 'id', label: 'id', minWidth: 80},
        {prop: 'nickname', label: '昵称', minWidth: 130},
        {prop: 'account', label: '帐号', minWidth: 150},
        {prop: 'avatar', label: '头像', type: 'image', minWidth: 80},
        {prop: 'created_at', label: '创建时间', type: 'timestramp', minWidth: 170},
    ],
    labelKey: "nickname",
};


/**
 * 获取权限节点数据
 */
export const getPermissionsDataApi = (): Promise<HttpResultData<any>> => request(`/filter-panel/permissions-data`)